package org.pralu.siruri;

import java.util.Scanner;

public class Ecuatie {

	/*
	 * se citesc a si b, nr reale. Sa se rezolve ecuatia de gr 1 ax+b=0
	 */
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		double a;
		double b;
		System.out.print("introduceti nr a: ");
		a = in.nextInt();
		System.out.print("introduceti nr b: ");
		b = in.nextInt();
		double x;
		x = 0;
		if (a != 0) {
			x = -b / a; 
			System.out.println("solutia ecuatiei ax+b=0 este " + x);}
			else if (b != 0) {
			System.out.println("ecuatia nu admite solutii");
				} else  {
			System.out.println("ecuatia admite o infinitate de solutii");
				}
			}
}
